package project.AbM;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.os.Handler;
import android.view.WindowManager;
import android.widget.TextView;


public class splashScreenActivity extends Activity {
	
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        getWindow().setFormat(PixelFormat.RGBA_8888);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);

        setContentView(R.layout.splashscreen);
        
        PackageManager pm = getPackageManager();
        try {
			PackageInfo pi = pm.getPackageInfo("project.AbM", 0);
			TextView versionNumber = (TextView) findViewById(R.id.versionNumber);           
            versionNumber.setText("Android Blog Manager \n Version " + pi.versionName);
		} catch (NameNotFoundException e) {
			e.printStackTrace();
		}
             
        
        new Handler().postDelayed(new Runnable(){ 
            public void run() { 
                 Intent mainIntent = new Intent(splashScreenActivity.this,ListBlogActivity.class); 
                 splashScreenActivity.this.startActivity(mainIntent); 
                 splashScreenActivity.this.finish(); 
            } 
       }, 5000); //temps d'attente
        
}
}
